package com.manage.api.controller;

import com.manage.common.result.Result;
import com.manage.pojo.dto.ElectronicFileDTO;
import com.manage.service.ElectronicFileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/electronicFile")
@Tag(name = "电子卷宗管理",description="电子卷宗管理接口")
public class ElectronicFileController {

    @Autowired
    private ElectronicFileService electronicFileService;

    @GetMapping("/getCaseInfoById")
    @Operation(summary = "根据ID获取电子卷宗的案件信息")
    public Result getById(@RequestParam Integer id) {
        return electronicFileService.getCaseInfoById(id);
    }

    @PostMapping("/getCaseStageDetailByCaseStage")
    @Operation(summary = "根据案件id和显示标签获取案件的不同阶段信息")
    public Result getCaseStageDetailByCaseStage(@RequestBody ElectronicFileDTO electronicFileDTO) {
        return electronicFileService.getCaseStageDetailByCaseStage(electronicFileDTO);
    }

    @GetMapping("/getAllCaseStageInfoByCaseId")
    @Operation(summary = "根据案件id获取案件进度的所有阶段信息")
    public Result getAllCaseStageInfoByCaseId(@RequestParam Long caseId) {
        return electronicFileService.getAllCaseStageInfoByCaseId(caseId);
    }
}
